var map = L.mapbox.map('map', 'examples.map-20v6611k');
var geoJson = [];

function loadDetailMap(){
    var jSonData = window.webConnector.getResult();

    var myObject = jQuery.parseJSON(jSonData);
    var center = [];

    jQuery.each(myObject.list, function(index, value) {
        geoJson[index] = {
          "type": "Feature",
          "geometry": {
            "type": "Point",
            "coordinates": [value['lng'], value['lat']]
          },
          "properties": {
            "title": value['address'],
            'marker-color': '#0099ff'
          }
        };
        center = [value['lat'], value['lng']];
    });

    map.markerLayer.setGeoJSON(geoJson);
    map.setView(center, 13);
}
